unit uSBD_Crypto_CBC;
interface
uses Classes, uSBD_Crypto_StreamCipher, uSBD_Crypto_BlockCipher;

type

TCBC = class( TInterfacedObject, IBlockChainingModel)
  protected
    function Chain_EncryptBlock(
      Key: TSymetricKey; InitializationVector: TMemoryStream;
      const Cipher: IBlockCipher; const Param: IInterface): TBlockChainLink;

    function Chain_DecryptBlock(
      Key: TSymetricKey; InitializationVector: TMemoryStream;
      const Cipher: IBlockCipher; const Param: IInterface): TBlockChainLink;

    function  DisplayName: string;
    function  ProgId: string;
    function  Features: TAlgorithmicFeatureSet;
  end;

TCBCLink = class( TBlockChainLink)
  public
    procedure Encrypt_Block( Plaintext{in}, Ciphertext{out}: TMemoryStream);  override;
    procedure Decrypt_Block( Plaintext{out}, Ciphertext{in}: TMemoryStream);  override;
  end;


implementation




{ TCBC }

function TCBC.Chain_DecryptBlock( Key: TSymetricKey;
  InitializationVector: TMemoryStream; const Cipher: IBlockCipher;
  const Param: IInterface): TBlockChainLink;
begin
// tbd
result := nil
end;



function TCBC.Chain_EncryptBlock( Key: TSymetricKey;
  InitializationVector: TMemoryStream; const Cipher: IBlockCipher;
  const Param: IInterface): TBlockChainLink;
begin
// tbd
result := nil
end;



function TCBC.DisplayName: string;
begin
result := 'CBC'
end;



function TCBC.Features: TAlgorithmicFeatureSet;
begin
result := [afNotImplementedYet]
end;

function TCBC.ProgId: string;
begin
result := 'native.CBC'
end;





{ TCBCLink }

procedure TCBCLink.Decrypt_Block( Plaintext, Ciphertext: TMemoryStream);
begin
// tbd
end;



procedure TCBCLink.Encrypt_Block( Plaintext, Ciphertext: TMemoryStream);
begin
// tbd
end;

end.

